package trouger.dmt;

/**
 * A filter that is applied in the map phase before a record is passed into MapperEntity.acceptLine.
 * Every incoming record will pass through this filter, if specified.
 */
public interface SourceRecordFilter {
	/**
	 * This method tells whether a record is valid.
	 * Besides, record fields can be modified in the method.
	 * @param sourceIndex the index(one-based) of the source table of the record
	 * @param segment the record, where segment[1] is the first field
	 * @return true if this record is considered to be valid, false to ignore this record.
	 */
	public boolean isValidRecord(int sourceIndex, String[] segment);
}
